package comment

import (
	"github.com/medivhzhan/weapp/message/template"
	"github.com/sirupsen/logrus"
	token2 "gitee.com/xiaofengfeng123/srv-paper-tape/api/token"
	"time"
)

func SendMsg(openid,formId,content string){
	msg := template.Message{
		"keyword1": content,
		"keyword2": time.Now().String(),
	}

	logrus.Println("fromId: %s,send msg to openid: %s",formId,openid)
	t := token2.NewWeToken()
	err := template.Send(openid,"5Sp8UvZEqmTl4UCdYgZmhPpa2hYxLiFARbJTLIumVVU","/pages/paperTape/PaperTape",formId,msg,"",t.Get())
	if err !=nil{
		logrus.Error(err.Error())
		return
	}
}